note counting machine for CSP